package com.chookss.video.util;

import com.chookss.video.model.VideoSourceModel;
import com.chookss.video.entity.VideoEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * Company:
 * Project:
 * Author: liuhaoge
 * Date: 2021/1/19 10:43
 * Note:
 */
public class VideoUtils {
    public static VideoSourceModel videoEntityToModel(VideoEntity e) {
        VideoSourceModel m = new VideoSourceModel();
        m.setVideo(e);
        return m;
    }

    public static List<VideoSourceModel> videoEntityToModel(List<VideoEntity> list) {
        List<VideoSourceModel> result = new ArrayList<>();
        for (VideoEntity e:list) {
            VideoSourceModel m = new VideoSourceModel();
            m.setVideo(e);
            result.add(m);
        }
        return result;
    }
}
